// 导入组件
import contextmenu from './contextmenu/index'
import fileShow from './fileShow/index'
import upload from './upload/index'
import folderShow from './folderShow/index'
import fileTable from './fileTable/index'
import loginBox from './loginBox/index'
import signinBox from './signinBox/index'
import resetBox from './resetBox/index'


// 组件列表
const components = [
  contextmenu,
  fileShow,
  upload,
  folderShow,
  fileTable,
  loginBox,
  signinBox,
  resetBox,
]

// 定义install方法，接受vue为参数，如果使用use注册组件，则所有组件都将被注册
const install = function(Vue){
  // 判断是否安装
  if(install.installed){
    return
  }
  //遍历注册所有组件
  components.forEach(item=>{
    Vue.component(item.name,item)
  })
}


export default{
  //导出install方法，Vue.use()方法安装
  install,
}

